<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| 用户端  非鉴权  API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::get('test', [\App\Http\Controllers\Api\TestController::class, 'test']);
//公共接口
//获取短信验证码
Route::get('get_phone_code', [\App\Http\Controllers\Api\SmsController::class, 'getPhoneCode']);
//获取图形验证码
Route::get('get_img_code', [\App\Http\Controllers\Api\SmsController::class, 'getImgCode']);
//提交图形验证码
Route::get('send_img_code', [\App\Http\Controllers\Api\SmsController::class, 'sendImgCode']);
//获取七牛token
Route::get('get_qiniu_token', [\App\Http\Controllers\Api\QiNiuController::class, 'getQiNiuToken']);

//获取版本
Route::get('check_version', [\App\Http\Controllers\Api\AppController::class, 'checkVersion']);
//获取公告
Route::get('get_notice', [\App\Http\Controllers\Api\AppController::class, 'getNotice']);


//忘记登录密码
Route::post('forget_password', [\App\Http\Controllers\Api\UserController::class, 'forgetLoginPassword']);

//注册
Route::post('register', [\App\Http\Controllers\Api\RegisterController::class, 'register']);
//账号密码登录
Route::post('login', [\App\Http\Controllers\Api\LoginController::class, 'login']);
//短信验证码登录
Route::post('code_login', [\App\Http\Controllers\Api\LoginController::class, 'codeLogin']);


//新闻资讯
Route::prefix('news')->group(function () {
    //分类列表
    Route::get('cate_news', [\App\Http\Controllers\Api\NewsController::class, 'cate_news']);
    //资讯列表
    Route::get('news_list', [\App\Http\Controllers\Api\NewsController::class, 'newsList']);


});

//协议接口
Route::prefix('app_protocol')->group(function () {
    //协议列表
    Route::get('list', [\App\Http\Controllers\Api\AppProtocolController::class, 'getAppProtocolList']);
    //协议详情
    Route::get('info', [\App\Http\Controllers\Api\AppProtocolController::class, 'getAppProtocolInfo']);
});
